<script setup>
  import axios from 'axios'
  import { ref, reactive } from 'vue';

  // let message = ref('')
  let message = reactive({
    code:'',
    content:''
  })

  function getLoveMessage(){
    let promise = axios({
      method:"post",
      url:"https://api.uomg.comss/api/rand.qinghua",
      data:{
        format:"json"
      }
    })

    promise.then(
      function (response) {
        console.log(response)
        // message.value = response.data.content
        Object.assign(message, response.data)
      }
    ).catch(
      function(error){
        console.log(error)
      }
    )
  }
</script>

<template>
  <div>
    <h1 v-text="message"></h1>
    <button @click="getLoveMessage()">变</button>
  </div>
  
</template>

<style scoped>

</style>
